package com.jwell.panrank.model

import com.jwell.driverapp.tools.BaseSubscriber
import com.jwell.panrank.application.App
import com.jwell.panrank.contract.ElectronicPoundContract
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * Created by 76577 on 2018/4/8.
 * 电子磅单列表
 */
class ElectronicPoundModel : ElectronicPoundContract.Model, BaseModel() {

    override fun searchListData(searchData: ElectronicPoundModel.RequestData, baseSubscriber: BaseSubscriber) {
        if (App.DEBUG) println("搜索电子磅单列表" + searchData.toString())
        getApiStore().getElectronicListPag(searchData)
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(baseSubscriber)
    }

    //    forBillCode (string, optional): 运单编码 ,
//    carNum (string, optional): 车牌号 ,
//    materialName (string, optional): 物质名称 ,
//    receivingUnit (string, optional): 收货单位 ,
//    forwardingUnit (string, optional): 发货单位 ,
//    weightNo (string, optional): 磅单号 ,
//    carMeasurePlaceDescr (string, optional): 计量点 ,
//    carMeasureByDescr (string, optional): 计量人 ,
//    startDate (string, optional): 计量时间-开始 ,
//    endDate (string, optional): 计量时间结束 ,
//    type (integer, optional): 计量类型 1、重车计量 2、空车计量 3、全部 ,
//    measurementType (integer, optional): 计量类别 1、外购-辅料 2、外购-其它 3、外购-大宗原燃料 4、外销 5、厂际 6、其它 = ['1', '2', '3', '4', '5', '6'],
//    supplierName (string, optional): 供应商名称 ,
//    searchType (integer, optional): 搜索关系 1、并且 2、或者 ,
//    mtrlOrderNo (string, optional): 合同号 ,
//    driverName (string, optional): 司机名称 ,
//    weightNumbers (Array[string], optional): 磅单号集合 -用于勾选导出 ,
//    sorting (string, optional): 排序字段 ,
//    HEAVY_CAR_WEIGHT_ROOM(string, optional): 磅房号
//    maxResultCount (integer, optional):
    data class RequestData(var maxResultCount: Int? = null,
                           var skipCount: Int? = null,
                           var type: Int? = null,
                           var forBillCode: String? = null,
                           var carNum: String? = null,
                           var materialName: String? = null,
                           var receivingUnit: String? = null,
                           var forwardingUnit: String? = null,
                           var weightNo: String? = null,
                           var carMeasurePlaceDescr: String? = null,
                           var carMeasureByDescr: String? = null,
                           var startDate: String? = null,
                           var endDate: String? = null,
                           var measurementType: Int? = null,
                           var supplierName: String? = null,
                           var searchType: Int? = null,
                           var mtrlOrderNo: String? = null,
                           var HEAVY_CAR_WEIGHT_ROOM: String? = null,
                           var remark: String? = null,
                           var driverName: String? = null)
}